import http from '@/utils/request'
// 处理组织架构模块的请求
/**
 * 获取部门列表
 */
export const reqGetDepartments = () => http({
  method: 'GET',
  url: '/company/department'
})

/**
 * 新增部门
 * @param {data} {code, introduce, manager, name, pid}
 */
export const reqAddDepartment = data => http({
  method: 'POST',
  url: '/company/department',
  data
})

/**
 * 根据id修改部门详情
 * @data   {*} form 部门的信息
 */
export const reqUpdateDepartDetail = form => http({
  method: 'PUT',
  url: `/company/department/${form.id}`,
  data: form
})

/**
 * 根据id查询部门详情
 * @param {*} id 部门的id
 */
export const reqGetDepartDetail = id => http({
  method: 'GET',
  url: `/company/department/${id}`
})

/**
 * 根据id删除部门
 * @param {*} id 部门id
 */
export const reqDelDepartment = id => http({
  method: 'DELETE',
  url: `/company/department/${id}`
})

/**
 * 获取员工的简单列表
 */

export const reqGetSimpleUserList = () => http({
  method: 'GET',
  url: '/sys/user/simple'
})
